const Sequelize = require('sequelize');
// 从index.js中解构获取sequelize实例
const { sequelize } = require('./index');

const MysteryBox = sequelize.define('mysteryBox', {
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  name: {
    type: Sequelize.STRING,
    allowNull: false
  },
  description: {
    type: Sequelize.TEXT
  },
  price: {
    type: Sequelize.DECIMAL(10, 2),
    allowNull: false
  },
  imageUrl: {
    type: Sequelize.STRING
  }
});

module.exports = MysteryBox;